package com.cap.bts.crmdp.dealer.remind.dao.impl;

import java.util.List;

import javax.inject.Inject;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Repository;

import com.cap.bts.crmdp.dealer.remind.dao.IHQPromotionDao;
import com.cap.bts.crmdp.dealer.remind.domain.HQPromotion;
import com.cap.bts.crmdp.dealer.remind.dto.ServiceRemindForMemberDto;
import com.cap.bts.framework.common.dao.impl.BaseDaoImpl;
import com.cap.bts.framework.common.exception.AppException;

@Repository("hQPromotionDao")
public class HQPromotionDaoImpl extends BaseDaoImpl<HQPromotion, Long> implements IHQPromotionDao {
	
	@Inject
	public HQPromotionDaoImpl(@Value("com.cap.bts.crmdp.dealer.remind.domain.HQPromotion") Class<HQPromotion> clazz) {
		super(clazz);
	}
	
	private static final Logger LOGGER = Logger.getLogger(HQPromotionDaoImpl.class);

	@Override
	public List<HQPromotion> getHQPromotionByIsSelected(ServiceRemindForMemberDto dto) throws AppException {
		String sql = "select * from tm_raw_HQ_promotion where is_selected = '1' and maintenance_type = '" + dto.getMaintenanceItem() + "'";
		return this.getListByNativeQuery(sql);
	}

}
